-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multiple targets #11
Conversation
Allow the user to define multiple targets to execute a consistent group of tasks.
It's actually possible to achieve this effect in a variety of ways without adding additional complexity to Dotbot. One way is the way I manage my dotfiles, with a common Another way to achieve an effect closer to what you have, with multiple targets that you can specify, is the following. You can have one file per target, #!/usr/bin/env bash
set -e
DEFAULT_CONFIG_PREFIX="default"
CONFIG_SUFFIX=".conf.yaml"
DOTBOT_DIR=".dotbot"
DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${BASEDIR}"
git submodule update --init --recursive "${DOTBOT_DIR}"
for conf in ${DEFAULT_CONFIG_PREFIX} ${@}; do
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${conf}${CONFIG_SUFFIX}"
done With this, for example, you can have a ./install mac work And it'll execute all three things. Unless there are additional reasons to add this complexity to Dotbot itself, I'd prefer to avoid the additional complexity. |
@anishathalye First: Thanks for your hard work on this... Came across dotbot yesterday and I'm already feeling the benefits Anyway: I thought I'd mention that I found your above comment extremely helpful. I'd suggest perhaps adding that to the README file. @nagromc and I can't be the only ones interested in different workflows / machine. Thanks again 🍻 |
Glad you're finding it useful! Good point on adding it to the README. I'll re-open this issue, and I'll get to making the change as soon as I can. |
Oh whoops nvm, this is a pull request, not an issue. See #72. |
Based on anishathalye/dotbot#11 (comment). - Adds config for MacOS - Renames install to default - Updates editor config for yaml files.
@anishathalye not 100% sure how my commit got to be in this pull request. I just added a link for reference in my commit. Please disregard. Sorry! ... and THANKS!!! I'm really loving centralizing my config files with dotbot. Who knew! |
Oh, no worries! I'm glad to hear that you've found the tool to be useful! 😄 |
Dunno what’s wrong with the example above but I’ve not manage to make it work. I had to change it to:
Can you verify if that makes sense @anishathalye ? |
huh, not sure why the first one doesn't work for you… |
The reason it doesn't work for @borisrorsvort might (emphasis might) be because the expansion isn't double-quoted in @anishathalye's example. |
After some more investigation it’s not executing the next files if they were errors in the default one |
Ah, okay... that's because of the |
Hi @anishathalye,
Please review this pull request allowing users to define targets.
If you have multiple hosts with different configurations, it is useful to execute a consistent group of tasks.